package Component

var componentMappin map[string]func() IComponent

func init() {
	componentMappin = make(map[string]func() IComponent)

	componentMappin["UploadFile"] = func() IComponent {
		return &UploadFileComponent{}
	}

	componentMappin["UploadFolder"] = func() IComponent {
		return &UploadFolderComponent{}
	}

	componentMappin["RemoteShell"] = func() IComponent {
		return &RemoteShellComponent{}
	}

	componentMappin["LocalShell"] = func() IComponent {
		return &LocalShellComponent{}
	}

}

func CreateComponent(name string) IComponent {
	f := componentMappin[name]

	if f != nil {
		return f()
	}

	return nil
}
